<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <center>
        <font style="font-weight: bold; font-size: 23px;">股民添加</font><br>
        <form id="form" class="layui-form">
            姓名：<input type="text" class="layui-input" name="name">
            性别：<input type="radio" name="gender" title="男" value="1">
                <input type="radio" name="gender" title="女" value="2">
            证券公司：<input type="text" class="layui-input" name="securitie">
            股东账号：<input type="text" class="layui-input" name="account">
            股东市值：<input type="text" class="layui-input" name="values">
            持仓股票：
            <div>
                股票代码：<input type="text" name="code" class="layui-input"> -- 股票名称<input class="layui-input" name="sname" type="text">
            </div>
        </form>
        <button onclick="add()" class="layui-btn">保存</button>
    </center>
</body>
<link rel="stylesheet" href="../views/js/layui/css/layui.css">
<script type="text/javascript" src="../views/js/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="../views/js/layui/layui.all.js"></script>
<script type="text/javascript">
    function add(){
        //序列化表单
        var info = $("form").serialize();
        $.post("../investor/add",info,function(res){
            if(res == "ok"){
                alert("添加成功！");
                location.href = "../views/investorList.html";
            }else{
                alert("添加失败！");
            }
        },'json')
    }
</script>
</html>